package cn.shyouchi.wuguanjia.android.ui.event.labor;

import android.graphics.Color;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import cn.shyouchi.wuguanjia.android.R;

/**
 * Created by Eenie on 2016/12/8 at 17:57
 * Email: 472279981@qq.com
 * Des:
 */

public class ApplyLaborAdapter extends BaseQuickAdapter<ApplyLaborEntity.ResultMessageBean,BaseViewHolder> {
    public ApplyLaborAdapter(List<ApplyLaborEntity.ResultMessageBean> data) {
        super(R.layout.item_apply_labor_layout, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, ApplyLaborEntity.ResultMessageBean entity) {
        holder.setText(R.id.tv_content, String.format("%1s    %2s    %3d天",entity.getUsername(),entity.getService().getServicesname(),entity.getDay()));
        if (entity.getCheckstatus()==1) {
            holder.setTextColor(R.id.tv_state, mContext.getResources().getColor(R.color.mainColor));
            holder.setText(R.id.tv_state, "审核通过");
        } else if (entity.getCheckstatus() == 2) {
            holder.setTextColor(R.id.tv_state, Color.parseColor("#42BB61"));

            holder.setText(R.id.tv_state, "审核中");
        } else if (entity.getCheckstatus() == 3) {
            holder.setTextColor(R.id.tv_state, Color.parseColor("#ff0000"));
            holder.setText(R.id.tv_state, "审核不通过");
        }
    }
}
